7 天前 · To make a checkbox checked by default, you give it the checked attribute. See the below example: html. Copy to Clipboard play. <fieldset> ... Try it · Additional attributes · Using checkbox inputs · Examples
The checked attribute can be used with <input type=checkbox> and <input type=radio> . The checked attribute can also be set after the page load, with a ...